class BossPlayerController extends UTPlayerController dependson(combatants);

var int i;

var bool allDead;

var BattleController b;

var partymember d;

//var Equipment helmet;
//var Equipment armor;
//var Equipment weapon;
//var Equipment subWeapon;
//var Equipment boots;
//var Equipment gloves;
//var Equipment accessory;

var config array<string> inventoryRecords;

//Inventory handeling code
//By Michiel 'elmuerte' Hendriks for Epic Games, Inc.
//used with permission

var array<BossItem> inventory;

var partymember temp;

simulated event postbeginplay ()
{
   super.postbeginplay();
   `log (self.getstatename());
   b = Spawn (class 'BattleController');
   b.loadPlayers();
   d = spawn (class 'PartyMemberOverWorld');
   //possess(d, false);
   SetBehindView(true);
   gotostate ('playerwalking');
   `log (self.getstatename());
}

reliable server function ServerBecomeActivePlayer()
{
}

function checkautoobjective (bool bOnlyNotifyDifferent)
{
}

function bool addInventory(BossItem item)
{
	i = inventory.find(item);
	if (i != INDEX_NONE) return false;
	inventory.addItem(item);
	inventoryRecords.addItem(string(item.name));
	return true;
}

function bool removeInventory(BossItem item)
{
	i = inventory.find(item);
	if (i == INDEX_NONE) return false;
	inventory.removeItem(item);
	inventoryRecords.removeItem(string(item.name));
	return true;
}

function startTurn (PartyMember p)
{
   possess(p, FALSE);
   p.startTurn();
}

function endFight ()
{
      local partymemberOverworld o;
      foreach allactors (class'partymemberoverworld', o)
      {
         possess (o, false);
      }
}

event Touch(Actor other, PrimitiveComponent OtherComp, Object.Vector HitLocation, Object.Vector HitNormal)
{
   //super.touch(other, OtherComp, HitLocation, HitNormal);
   b.startBattle();
   gotostate ('inFight');
}
